package com.laizhenghua.order.controller;

import com.laizhenghua.commons.entity.CommonResult;
import com.laizhenghua.commons.entity.PaymentEntity;
import com.laizhenghua.order.service.PaymentFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @date: 2022/2/11 22:23
 */
@RestController
@RequestMapping(path = "/payment")
public class OrderController {
    @Autowired
    private PaymentFeignService paymentFeignService;

    @RequestMapping(path = "/getById/{id}", method = RequestMethod.GET)
    public CommonResult<PaymentEntity> getPaymentById(@PathVariable(value = "id") Integer id) {
        return paymentFeignService.getPaymentEntityById(id);
    }

    @RequestMapping(path = "/timeoutTest", method = RequestMethod.GET)
    public CommonResult<String> timeoutTest() {
        return paymentFeignService.timeoutTest();
    }
}
